<#assign pojo=oneToManyPojo.getOne()>
<#assign many=oneToManyPojo.getMany()>
<#assign ones=oneToManyPojo.getOnes()>
<#assign fields=pojo.getFilterdPojoFields()>
<#assign declarationName = pojo.importType(pojo.getDeclarationName())>
<#assign declarationNameFirstLetterLower = pojo.importType(pojo.getDeclarationNameFirstLetterLower())>
<#assign realPackageAndClassPath = "${pojo.getRealPackageAndClassPath()}">
<#assign masterid = pojo.getDeclarationNameFirstLetterLower()+"Id">
<div *ngIf="visible">
  <nz-table #nzTable
            [nzAjaxData]="_dataSet"
            [nzSize]="'small'"
            [nzShowSizeChanger]="true"
            [nzLoading]="_loading"
            [nzTotal]="_total"
            [(nzPageIndex)]="_pageIndex"
            [(nzPageSize)]="_pageSize"
            (nzPageIndexChange)="_pageIndexChange()"
            (nzPageSizeChange)="_pageSizeChang()">
    <thead nz-thead>
    <tr>
      <th nz-th [nzCheckbox]="true">
        <label nz-checkbox [(ngModel)]="_allChecked" [nzIndeterminate]="_indeterminate"
               (ngModelChange)="_checkAll($event)">
        </label>
      </th>
<#assign fields=pojo.getPojoFields()>
<#foreach field in fields>
<#if field.getIsSampleField()>
      <th nz-th><span><#if field.getComment()?exists>${field.getComment()}<#else>${field.getName()}</#if></span></th>
</#if>
</#foreach>
      <th nz-th [nzWidth]="'120px'"><span>action</span></th>
    </tr>
    </thead>
    <tbody nz-tbody>
    <tr nz-tbody-tr *ngFor="let data of nzTable.data">
      <td nz-td [nzCheckbox]="true">
        <label nz-checkbox [(ngModel)]="data.checked" (ngModelChange)="_checkChange($event)">
        </label>
      </td>
<#assign fields=pojo.getPojoFields()>
<#foreach field in fields>
<#if field.getIsSampleField()>
      <td nz-td>
        <span>{{data.${field.getName()}}}</span>
      </td>
</#if>
</#foreach>
      <td nz-td>
      <span>
        <a (click)="onEdit.emit({entity:data})">Edit</a>
        <a (click)="onRemove.emit({entity:data})">删除</a>
        <a (click)="onProject.emit({entity:data})">项目管理</a>
      </span>
      </td>
    </tr>
    </tbody>
  </nz-table>
</div>
